/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author cjl
* @date 2023-05-16
**/
@Entity
@Data
@Table(name="dcc_user")
public class DccUser implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`open_id`",unique = true)
    @ApiModelProperty(value = "openId")
    private String openId;

    @Column(name = "`type`")
    @ApiModelProperty(value = "身份")
    private String type;

    @Column(name = "`user_name`")
    @ApiModelProperty(value = "昵称")
    private String userName;

    @Column(name = "`longitude`")
    @ApiModelProperty(value = "经度")
    private String longitude;

    @Column(name = "`latitude`")
    @ApiModelProperty(value = "纬度")
    private String latitude;

    @Column(name = "`address`")
    @ApiModelProperty(value = "所属街道")
    private String address;

    @Column(name = "`nick_name`")
    @ApiModelProperty(value = "昵称")
    private String nickName;

    @Column(name = "`phone`",unique = true)
    @ApiModelProperty(value = "联系方式")
    private String phone;

    @Column(name = "`email`")
    @ApiModelProperty(value = "邮箱")
    private String email;

    @Column(name = "`avatar`")
    @ApiModelProperty(value = "头像")
    private String avatar;

    @Column(name = "`passwod`")
    @ApiModelProperty(value = "密码")
    private String passwod;

    @Column(name = "`sex`")
    @ApiModelProperty(value = "性别")
    private String sex;

    @Column(name = "`groupid`")
    @ApiModelProperty(value = "用户分组")
    private String groupid;

    @Column(name = "`created_at`")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createdAt;

    @Column(name = "`updated_at`")
    @ApiModelProperty(value = "修改时间")
    private Timestamp updatedAt;

    @Column(name = "`identity`")
    @ApiModelProperty(value = "身份")
    private Integer identity;

    @Column(name = "`operator`")
    @ApiModelProperty(value = "操作者")
    private String operator;

    @Column(name = "`qianming`")
    @ApiModelProperty(value = "签名")
    private String qianming;


    public void copy(DccUser source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
